/**
 * 
 */
package com.gametheoryserver.gui.sum.state;

import java.util.Iterator;

import com.gametheoryserver.gui.sum.PlaySumGame;

/**
 * @author Tomas Barak
 * 
 */
public class GameChangeState extends PlaySumGameStateHolder implements ISumGameState {

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.gametheoryserver.gui.sum.state.ISumGameState#refreshGame(com.gametheoryserver.gui.sum.PlaySumGame)
	 */
	@Override
	public void refreshGame(PlaySumGame playSum) {
		int id = (int) playSum.getRowSelectComboBox().getValue();
		playSum.fillChipsComboBox(id - 1);
		Iterator it = playSum.getChipsSelectComboBox().getItemIds().iterator();
		if (it.hasNext())
			playSum.getChipsSelectComboBox().select(it.next());
		playSum.repaintControls();
	}

}
